package com.hhh.springai_test.model.enums;

import lombok.Getter;

@Getter
public enum BookBorrowStatusEnum {
    BORROWING(1, "借阅中"),
    RETURNED(2, "已归还"),
    OVERDUE(3, "已逾期"),
    RENEWED(4, "已续借"),
    PENDING(5, "待审核");

    private final int value;
    private final String text;

    BookBorrowStatusEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    public static String getTextByValue(int value) {
        for (BookBorrowStatusEnum statusEnum : BookBorrowStatusEnum.values()) {
            if (statusEnum.getValue() == value) {
                return statusEnum.getText();
            }
        }
        return "";
    }
}